// ********************************************************************************************
// Este archivo fuente es propiedad de Feria de Remates S.R.L. de C.V. Prohibida su copia o uso
// sin autorización explícita.
// This source file is propietary to Feria de Remates S.R.L. de C.V. May not be used or copied
// without explicit authorization.
// ********************************************************************************************/
package com.feriaderemates.domain.listing;

import java.math.BigDecimal;
import java.util.List;

/**
 *
 * @author Oscar García
 */
public class AuctionListing extends Listing {

    private BigDecimal initialPrice; //not updatable
    private int lengthInDays; //not updatable
    private boolean acceptingReturns; // only updatable from no to yes (this logic is not decided by the dao)
    private String returnRules; //only to add when not null
    private int daysToProcessShipment; //updatable by user only from more to less days
    private List<ShippingCarrier> shippingCarriers; //updatable by user only to add carriers
    private ItemCondition itemCondition; //updatable by user only if it's from worse to better
    private boolean canYouPickItUp; //updatable by user only if it's from no to yes
    //fields when viewing details
    private int numberOfBids; //non updatable by user
    private BigDecimal currentPrice;//non updatable by user

    private AuctionListing(String sellerUsername) {
        this.username = sellerUsername;
    }

    public static AuctionListing createFixedPriceListing(int userId, String sellerUsername) {
        return new AuctionListing(sellerUsername);
    }

    /**
     * @return the initialPrice
     */
    public BigDecimal getInitialPrice() {
        return initialPrice;
    }

    /**
     * @param initialPrice the initialPrice to set
     */
    public void setInitialPrice(BigDecimal initialPrice) {
        this.initialPrice = initialPrice;
    }

    /**
     * @return the lengthInDays
     */
    public int getLengthInDays() {
        return lengthInDays;
    }

    /**
     * @param lengthInDays the lengthInDays to set
     */
    public void setLengthInDays(int lengthInDays) {
        this.lengthInDays = lengthInDays;
    }

    /**
     * @return the acceptingReturns
     */
    public boolean isAcceptingReturns() {
        return acceptingReturns;
    }

    /**
     * @param acceptingReturns the acceptingReturns to set
     */
    public void setAcceptingReturns(boolean acceptingReturns) {
        this.acceptingReturns = acceptingReturns;
    }

    /**
     * @return the returnRules
     */
    public String getReturnRules() {
        return returnRules;
    }

    /**
     * @param returnRules the returnRules to set
     */
    public void setReturnRules(String returnRules) {
        this.returnRules = returnRules;
    }

    /**
     * @return the daysToProcessShipment
     */
    public int getDaysToProcessShipment() {
        return daysToProcessShipment;
    }

    /**
     * @param daysToProcessShipment the daysToProcessShipment to set
     */
    public void setDaysToProcessShipment(int daysToProcessShipment) {
        this.daysToProcessShipment = daysToProcessShipment;
    }

    /**
     * @return the shippingCarriers
     */
    public List<ShippingCarrier> getShippingCarriers() {
        return shippingCarriers;
    }

    /**
     * @param shippingCarriers the shippingCarriers to set
     */
    public void setShippingCarriers(List<ShippingCarrier> shippingCarriers) {
        this.shippingCarriers = shippingCarriers;
    }

    /**
     * @return the itemCondition
     */
    public ItemCondition getItemCondition() {
        return itemCondition;
    }

    /**
     * @param itemCondition the itemCondition to set
     */
    public void setItemCondition(ItemCondition itemCondition) {
        this.itemCondition = itemCondition;
    }

    /**
     * @return the sellerUsername
     */
    public String getSellerUsername() {
        return username;
    }


    /**
     * @return the numberOfBids
     */
    public int getNumberOfBids() {
        return numberOfBids;
    }

    /**
     * @param numberOfBids the numberOfBids to set
     */
    public void setNumberOfBids(int numberOfBids) {
        this.numberOfBids = numberOfBids;
    }

    /**
     * @return the currentPrice
     */
    public BigDecimal getCurrentPrice() {
        return currentPrice;
    }

    /**
     * @param currentPrice the currentPrice to set
     */
    public void setCurrentPrice(BigDecimal currentPrice) {
        this.currentPrice = currentPrice;
    }

    /**
     * @return the canYouPickItUp
     */
    public boolean isCanYouPickItUp() {
        return canYouPickItUp;
    }

    /**
     * @param canYouPickItUp the canYouPickItUp to set
     */
    public void setCanYouPickItUp(boolean canYouPickItUp) {
        this.canYouPickItUp = canYouPickItUp;
    }
}
